<?php
/**
 * Created by PhpStorm.
 * User: kb130
 * Date: 2017/8/21
 * Time: 15:14
 */

namespace util\validate\rules;

/**
 * 验证必须是合法的ip地址
 *
 * Class Ip
 * @package util\validate\rules
 */
class Ip extends BaseRule
{
    public function verify()
    {
        $res = ip2long($this->value);

        if (false !== $res) {
            return true;
        }

        return false;
    }
}